package no05;

/**
 * @author 兴趣使然黄小黄
 * @version 1.0
 * @date 2023/4/24 14:51
 * 替换空格
 */
public class Solution {

    public static String replaceSpace(String s) {
        StringBuilder res = new StringBuilder();
        for(char c : s.toCharArray()) {
            if(c == ' ') {
                res.append("%20");
            } else {
                res.append(c);
            }
        }
        return res.toString();
    }
}
